package util.ui;
import jpave.dataholders.MainData;
/**
 * 
 * ZZZ though these are access, they never seem to be called in reality
 *
 */
public class ClusterListRow implements ColumnwiseIndexer
{
	public int getNumFields ( ) { return 5; }

	public String getFieldNameByID ( int i ) {
		System.err.println("ZZZ getField " + i);	
		switch ( i ) {
			case 0: return "Cluster ID";
			case 1: return "# Contigs";
			case 2: return "# Singletons";
			case 3: return "# ESTs";
			case 4: return "Best Match";
			case 5: return "Min E-Value";
			case 6: return "Max E-Value";
			default:return null;
		}
	}

	public Object extractFieldByID ( Object obj, int i ) {
		MainData theCluster = (MainData)obj;
	System.err.println("ZZZ extractFiled " + i);	
        switch ( i ) {
            case 0: return theCluster.getClusterID();
            case 1: return new Integer ( theCluster.getNumNonSingletons() );
            case 2: return new Integer ( theCluster.getNumSingletons () );
            case 3: return new Integer ( theCluster.getNumESTs() );
            case 4: return theCluster.getBestMatch();
            case 5: return new Double ( theCluster.getMinEValue() );
            case 6: return new Double ( theCluster.getMaxEValue() );
            default:return null;
        }
	}
	
	public boolean isFieldSortableByID ( int i ) { return true; }
	
	public String[] getFieldNames( ) { return null; } 
	public boolean isFieldVisible( String strFieldName ) { return false; } 
	public boolean isFieldRequired( String strFieldName ) { return false; } 
	public void setVisibleFieldNames ( Object[] fieldNames ) { } 
	public String[] getVisibleFieldNames ( ) { return null; } 
}
